/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ins.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.ins.dao.InsCategoryDao;
import com.thinkgem.jeesite.modules.ins.entity.InsCategory;

/**
 * 检验报告书-分类Service
 * @author fanqinglong
 * @version 2017-11-20
 */
@Service
@Transactional(readOnly = true)
public class InsCategoryService extends TreeService<InsCategoryDao, InsCategory> {

	public InsCategory get(String id) {
		return super.get(id);
	}
	
	public List<InsCategory> findList(InsCategory insCategory) {
		if (StringUtils.isNotBlank(insCategory.getParentIds())){
			insCategory.setParentIds(","+insCategory.getParentIds()+",");
		}
		return super.findList(insCategory);
	}
	
	@Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED,readOnly = false, rollbackFor = Exception.class)
	public void save(InsCategory insCategory) {
		super.save(insCategory);
	}
	
	@Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED,readOnly = false, rollbackFor = Exception.class)
	public void delete(InsCategory insCategory) {
		super.delete(insCategory);
	}
	
}